#include "GameOverState.h"

GameOverState::GameOverState(GameContext& gameC)
	:	GameState(gameC)
{}
GameOverState::~GameOverState()
{}
void GameOverState::Load()
{
	float xPos(IniFile_GetInt("WinWidth", 800)/2);
	xPos -= 80;
	mCursor.Load("sword.png");
	mGameOverBG.Load("Game_Over_bg.png");
	mGameOverButton.Load("button_on   .png", "button_off.png");
	mGameOverButton.SetPosition(SGE::SVector2(xPos, 400.0f));
	mGameOverButton.SetText("Main Menu", 255, 255, 0);
}
void GameOverState::Unload()
{
	mCursor.Unload();
	mGameOverBG.Unload();
	mGameOverButton.Unload();
}
NextStates GameOverState::Update(float deltaTime)
{
	mCursor.Update(deltaTime);
	mGameOverBG.Update(deltaTime);
	mGameOverButton.Update(deltaTime);
	NextStates nextState = None;
	if(mGameOverButton.IsPressed())
	{
		nextState = Frontend;
	}
	return nextState;
}
void GameOverState::Render()
{
	mGameOverBG.Render();
	mGameOverButton.Render();
	mCursor.Render();
}